Repository navigation
Stop packaging the unused Apple Metal accelerator from v0.19 - #118
Merged
Merged
Conversation
v0.19 LiteRtLm links its GPU accelerator (ml_drift Metal on iOS, WebGPU on macOS), and LiteRT registers it before searching for a shared one, so the prebuilt libLiteRtMetalAccelerator is never opened (llamadart#1798). Packaging now skips it on iOS and macOS, requires the static accelerator symbol in LiteRtLm, and rejects a candidate that still ships it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stops shipping
libLiteRtMetalAcceleratoron iOS and macOS from v0.19: LiteRT never opens it. Owner side of leehack/llamadart#1798.Why it is unused. v0.19
LiteRtLmlinks its GPU accelerator (iOS:GpuMetalAccelerator,ml_drift_metal_accelerator.cc; macOS:GpuWebGpuAccelerator). LiteRTgpu_registry.ccat the pinneddcb657e8registers the statically linked accelerator first and only searches for shared accelerators when none registered.Evidence (v0.19.1-2 binaries, Qwen3-0.6B
.litertlm, M4 Max):libLiteRtLm, Gemma provider, DawnlibLiteRtdylibRegisterAccelerator: name=GPU WebGPU,Statically linked GPU accelerator registered., Dawnbackend=Metal, GPU answer4Frameworks/LiteRtLm.frameworkonlyLiteRtMetalAccelerator.frameworkname=GPU Metal,Statically linked GPU accelerator registered.,delegate_metal.mm: Created a Metal device, GPU answer42LiteRtMetalAccelerator.frameworkpresentDYLD_PRINT_LIBRARIESnever loads itNo run logs
Attempting to load GPU accelerator.Change
has_prebuilt_apple_metal_accelerator(tag)(false from v0.19) gates packaging:package_upstream_prebuiltsskips the Apple Metal prebuilt,ios_dlopen_dependenciesdrops it, so neither the runtime archives nor the SwiftPM set contain it (noLiteRtMetalAcceleratorXCFramework).LiteRtLmmust contain the static accelerator symbol for its platform, so an upstream change that drops static linkage fails packaging instead of shipping a GPU-less runtime.validate_runtime_artifactsrejects a v0.19 candidate that still carries the Metal payload;required_spm_assets/allowed_spm_assetsdrop its zip from v0.19. v0.16–v0.18 unchanged.LiteRtLmbytes are unchanged (no build input changes); the iOS framework-path patch stays.Out of scope, follow-up in llamadart: the macOS
libLiteRtWebGpuAccelerator/libLiteRtdylibs and the iOSlibLiteRtare also unopened by the GPU path above.Verification:
python3 -m unittest discover -s tools -p 'test_*.py'450 tests OK (new: prebuilt skip per platform/tag, v0.19 inventories, static-symbol requirement with and without the symbol). Full-matrix PR qualification below; GPU re-qualification of the packaged candidate is done downstream in llamadart.